<div class="panel panel-default">

    <ul class="nav nav-tabs" style="margin-top: 5px; padding-left: 10px;">
  
        <li class="{if (empty($rd) || $rd=='index')}active{/if}">
        <a href="{php echo $this->createWebUrl('sbroker', array('op' => $operation))}"> 
			 {$submenus[$operation]['name']}列表</a></li>
       
    </ul>

 
	<div class="panel-body">
        <form  method="POST" class="form-horizontal" role="form">
            <div class="search-box" style="margin-bottom: 20px; width: 100%; align-items: center; ">          
			 
				<div  style="margin-right: 10px;">
                    <span >关键字 :</span>
                </div>

				<div class="col-sm-6" style="margin-right: 10px;">

					<input class="form-control" name="keyword" id=""
                    placeholder="请输入经纪人姓名或者手机号"
                     type="text" value="{$_GPC['keyword']}">

				</div>
                   <div  style="margin-right: 10px;">

					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>

				</div>                             
            
            </div>
       </form>
       
         
		<table class="table table-hover">
			<thead class="navbar-inner"> 
				<tr>
                    <th style="width:5%;">ID</th>	
                    <th style="width: 10%;">头像</th>				 
					<th style="width:20%;">昵称</th>
				 	<th style="width:15%;">手机号 </th>
					 <th style="width:15%;">时间</th> 
                      <th style="width:5%;">状态</th>  
					  {if $operation=='broker'}
					  <th style="width:	5%;">房源</th>  
					  {/if}                
                    <th style="text-align:right; width:10%;">管理</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['id']}</td>
					<td>
                        {if $item['avatar']}
                        <img alt="{$item['openid']}" title="{$item['openid']}"
                                src="{php echo tomedia($item['avatar'])}" width="60" height="60"/>
                        {/if}
                                           
					</td>
                        <td>
                        <p title="{$item['openid']}">{$item['nickname']}  </p>
						<!-- 经纪人的属性 -->
						{if $item['iscompany']} 
						<p>姓名：{$item['truename']} <br/>
						 门店：{$admin[$item['shopid']]}<br/>
						 岗位：{$cgid_option[$item['cgid']]}</p>
						{/if}
                         
					</td>
					<td>
                             <p>{$item['mobile']} </p>
							 {if $item['iscompany']==0}
							 <p><label class="label label-info">用户</label></p>
							  {/if}
							 {if $item['iscompany']}
							<p><label class="label label-success">经纪人</label></p>
							 {/if}
					</td>
					<td>
						<p>更新:{php echo date('Y-m-d H:i:s',$item['updated_time'])} </p>
						<p style="color: #999;">加入:{php echo date('Y-m-d H:i:s',$item['created_time'])} </p>
			   		</td>
                      <td>
                            <p>  {if $item['disabled']==1}
                                <span onclick="setProperty(this, {$item['id']},'disabled' )" data="{$item['disabled']}" class='btn label label-default'>禁用</span>
                                {else}
                                <span onclick="setProperty(this, {$item['id']},'disabled' )" data="{$item['disabled']}" class='btn label label-success'>正常</span> 
                                {/if}   </p>
					</td>
					{if $operation=='broker'}
					<!-- 查询经纪人的房源数量 -->
					{php $total =  pdo_fetch("select count(*) as total from ".tablename('kbwdl_house')." where broker_id=:broker_id ",['broker_id'=> $item['id']])}
					<td> {$total['total']} 条 </td>

					{/if} 
					<td style="text-align:right;">
						<a href="{php echo $this->createWebUrl('sbroker', array('id' => $item['id'], 'op' => 'editbroker'))}" class="btn btn-default btn-sm"   title="编辑">
							编辑</a>
					
					</td>

				</tr>

				{/loop}

			</tbody>

		</table>

		{$pager}

	</div>
    